package Notepad;


public class Page {
	private String title;
	private String text;

	Page(String title) {
		if (title != null)
			this.title = title;
		else
			title = "";
		text = "";
	}

	public void containDigits() {

	}

	public void addText(String text) {
		if (text != null)
			this.text += text;
		this.title = "Title ";

	}

	public void removeText() {
		this.text = "";
		this.title = "";
	}

	public String getPageContent() {
		return this.title + "\n" + this.text;
	}

	public boolean searchWord(String word) {
		if (text != null && !text.equals("") && text.indexOf(word) != -1)
			return true;
		else
			return false;
	}

	boolean containsDigits() {
		for (int i = 0; i <= text.length(); i++) {
			if (text.matches(".*\\d.*")) {
				return true;
			}
		}
		return false;
	}
}
